import BaseConfig from '../components/BaseConfig';
import Rag from '../page/Rag';
import Document from '../page/Document';
import Layout from '../layout/Layout'; // 需要创建这个Layout组件
import Login from '../page/Login';
import { Navigate } from 'react-router-dom';
import DataSet from '../page/DataSet';
import Project from '../page/Project';
import Dictionary from '../page/Dictionary';
import FineTuning from '../page/FineTuning';
import ChatWhite from '../page/chat/ChatWhite';
import ChatBlack from '../page/chat/ChatBlack';
import User from '../page/User';
import KnowledgeDocumnet from '../page/knowledge/KnowledgeDocumnet';
import Ollama from '@/page/Ollama';

const routes = [
    {
        path: '/rag',
        element: <Layout />,
        children: [
            { path: 'project', element: <Project /> },
            { path: 'document', element: <Document /> },
            { path: 'knowledge', element: <KnowledgeDocumnet /> },
        ],
    },
    {
        path: '/llm',
        element: <Layout />,
        children: [
            { path: 'dataset', element: <DataSet /> },
            { path: 'tuning', element: <FineTuning /> },
        ],
    },
    {
        path: '/sys',
        element: <Layout />,
        children: [
            { path: 'baseConfig', element: <BaseConfig /> },
            { path: 'dictionary', element: <Dictionary /> },
            { path: 'user', element: <User /> },
            { path: 'ollama', element: <Ollama /> },
        ],
    },
    { path: '/edit', element: <Rag /> },
    { path: '/chat', element: <ChatWhite /> },
    { path: '/chatBlack', element: <ChatBlack /> },
    { path: '/login', element: <Login /> },
    {
        path: '*',
        element: <Navigate to="/rag/project" replace />
    }
];

export default routes;